﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="FlightReservations.aspx.cs" Inherits="InhollandAir.FlightReservations" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    <h2>Book your flight </h2>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyPlaceHolder" runat="server">
    <link rel="stylesheet" href="/Css/jquery-ui.css" /><script src="/Scripts/jquery-ui-1.10.2.min.js"></script>
    <style>
        label {
            display: inline;
        }
    </style>
    <script>
        $(function () {
            $("#BodyPlaceHolder_txt_DepartureDate").datepicker();
            $("#BodyPlaceHolder_txt_ReturnDate").datepicker();
        });
    </script>
    <form runat="server">

        <h6>
            <table id="tbl_state" runat="server" align="center" width="auto" border="0">
                <tr>
                    <td>
                        <asp:Label ID="lbl_Search" runat="server" Text="Search ----> "></asp:Label></td>
                    <td>
                        <asp:Label ID="lbl_FlightDetails" runat="server" Text="Flight  Details ----> " ForeColor="Silver"></asp:Label></td>
                    <td>
                        <asp:Label ID="lbl_PassengerInfo" runat="server" Text="Passenger Informations ----> " ForeColor="Silver"></asp:Label></td>
                    <td>
                        <asp:Label ID="lbl_Payment" runat="server" Text="Payment" ForeColor="Silver"></asp:Label></td>                   
                </tr>
            </table>
        </h6>
        <br />
        <asp:MultiView ID="mv_Booking" runat="server" ActiveViewIndex="0">
            <asp:View ID="vw_Search" runat="server">
                <table id="Table1" runat="server" align="center" width="auto" border="0">
                    <tr align="left">
                        <td></td>
                        <td class="auto-style1">
                            <asp:RadioButton ID="rb_Return" runat="server" Text=" Return" GroupName="FlightType" Checked="True" TextAlign="Right" AutoPostBack="True" OnCheckedChanged="rb_Return_CheckedChanged" />
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:RadioButton ID="rb_OneWay" runat="server" Text=" One way" GroupName="FlightType" AutoPostBack="True" OnCheckedChanged="rb_OneWay_CheckedChanged" /></td>
                    </tr>
                    <tr align="left">
                        <td>From</td>
                        <td class="auto-style1">
                            <asp:DropDownList ID="ddl_From" runat="server" DataSourceID="SqlCountryDS" DataTextField="country" DataValueField="country"></asp:DropDownList>
                            <asp:SqlDataSource ID="SqlCountryDS" runat="server" ConnectionString="<%$ ConnectionStrings:inairProductionConnectionString %>" SelectCommand="SELECT [country] FROM [airport]"></asp:SqlDataSource>
                        </td>
                    </tr>
                    <tr align="left">
                        <td>To</td>
                        <td class="auto-style1">
                            <asp:DropDownList ID="ddl_To" runat="server" DataSourceID="SqlCountryDS" DataTextField="country" DataValueField="country"></asp:DropDownList></td>
                    </tr>
                    <tr align="left">
                        <td></td>
                        <td class="auto-style1">&nbsp;</td>
                    </tr>
                    <tr align="left">
                        <td>Departure</td>
                        <td class="auto-style1">
                            <asp:TextBox ID="txt_DepartureDate" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr align="left">
                        <td>Return</td>
                        <td class="auto-style1">
                            <asp:TextBox ID="txt_ReturnDate" runat="server"></asp:TextBox></td>
                    </tr>
                    <tr align="left">
                        <td></td>
                        <td class="auto-style1"></td>
                    </tr>
                    <tr align="left">
                        <td>Passengers</td>
                        <td class="auto-style1">
                            <asp:DropDownList ID="ddl_Passengers" runat="server">
                                <asp:ListItem Selected="True">1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                            </asp:DropDownList></td>
                    </tr>
                </table>
                <asp:Button ID="btn_Search" runat="server" Text="Search" CssClass="btn" OnClick="btn_Search_Click" /><br />
                <asp:RequiredFieldValidator ID="rfv_Departure" runat="server" ControlToValidate="txt_DepartureDate" ErrorMessage="Please select a departure date." Font-Size="Medium" ForeColor="Red"></asp:RequiredFieldValidator>
                <br />
                <asp:CompareValidator ID="cv_PastDate" runat="server" ControlToCompare="txt_DepartureDate" ControlToValidate="txt_ReturnDate" CssClass="alert-error" ErrorMessage="Returndate cannot be before the departuredate ." Operator="GreaterThanEqual"></asp:CompareValidator>
                <br />
                <asp:Label ID="lbl_Info" runat="server" Font-Size="Medium" ForeColor="Red"></asp:Label>
            </asp:View>
            <asp:View ID="vw_FlightDetails" runat="server">
                <asp:Table ID="tbl_V1_FD_Departure" runat="server" CssClass="table" BorderStyle="Solid">
                    <asp:TableRow>
                        <asp:TableHeaderCell ColumnSpan="5" ForeColor="#9d426b">
                            <h2>Departure
                            <asp:Label ID="lbl_V1_DepDate" runat="server" Text=""></asp:Label></h2>
                        </asp:TableHeaderCell>
                    </asp:TableRow>
                    <asp:TableRow ForeColor="#FFCC9966" Font-Bold="true">
                        <asp:TableCell>Price</asp:TableCell><asp:TableCell>Departure</asp:TableCell><asp:TableCell>Arrival</asp:TableCell><asp:TableCell>Travel Time</asp:TableCell><asp:TableCell>Flight Number</asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="lbl_V1_Dep_Price" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Dep_Departure" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Dep_Arival" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Dep_TravelTime" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Dep_IntFlightNumber" runat="server" Text=""></asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
                <asp:Table ID="tbl_V1_FD_Return" runat="server" CssClass="table" BorderStyle="Solid" Visible="true">
                    <asp:TableRow>
                        <asp:TableHeaderCell ColumnSpan="5" ForeColor="#9d426b">
                            <h2>Return
                            <asp:Label ID="lbl_V1_RetDate" runat="server" Text=""></asp:Label></h2>
                        </asp:TableHeaderCell>
                    </asp:TableRow>
                    <asp:TableRow ForeColor="#FFCC9966" Font-Bold="true">
                        <asp:TableCell>Price</asp:TableCell><asp:TableCell>Departure</asp:TableCell><asp:TableCell>Arrival</asp:TableCell><asp:TableCell>Travel Time</asp:TableCell><asp:TableCell>Flight Number</asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell>
                            <asp:Label ID="lbl_V1_Ret_Price" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Ret_Departure" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Ret_Arival" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Ret_TravelTime" runat="server" Text=""></asp:Label>
                        </asp:TableCell><asp:TableCell>
                            <asp:Label ID="lbl_V1_Ret_IntFlightNumber" runat="server" Text=""></asp:Label>
                        </asp:TableCell>
                    </asp:TableRow>
                </asp:Table>
                <asp:Label ID="lbl_V1_Info" runat="server" CssClass="alert-danger"></asp:Label>
                <br />
                <asp:Button ID="btn_V1_PreScreen" runat="server" Text="Previous Screen" CssClass="btn" OnClick="btn_V1_PreScreen_Click" />
                <asp:Button ID="btn_V1_Continue" runat="server" Text="Continue" CssClass="btn" OnClick="btn_V1_Continue_Click" />
            </asp:View>            
            <asp:View ID="vw_PassengerInfo" runat="server"><br />
                <table class="table">
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Firstname" runat="server" Text="Label">Firstname</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Firstname" runat="server"></asp:Label>
                        </td>

                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Lastname" runat="server" Text="Label">Lastname</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Lastname" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Email" runat="server" Text="Label">Email</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Email" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Adress" runat="server" Text="Label">Adress</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Address" runat="server"></asp:Label>
                        </td>

                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Zipcode" runat="server" Text="Label">Zipcode</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Zipcode" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_City" runat="server" Text="Label">City</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_City" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Country" runat="server" Text="Label">Country</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Country" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Phonenr" runat="server" Text="Label">Phonenr</asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Phonenr" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_DateOfBirth" runat="server" Text="Label">BirthDate</asp:Label><br />
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_DateOfBirth" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V2_Airmiles" runat="server" Text="Label">Airmiles</asp:Label><br />
                        </td>
                        <td>
                            <asp:Label ID="txt_V2_Airmiles" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><asp:LinkButton ID="lb_V2_UpdateAccount" runat="server" CssClass="icon-pencil" OnClick="lb_V2_UpdateAccount_Click"> Edit Passenger Infromation</asp:LinkButton></td>
                    </tr>
                </table>
                <asp:Button ID="btn_V2_PreScreen" runat="server" CssClass="btn" Text="Previous Screen" OnClick="btn_V2_PreScreen_Click" />
                <asp:Button ID="btn_V2_Continue" runat="server" Text="Continue" CssClass="btn" OnClick="btn_V2_Continue_Click" />
            </asp:View>
            <asp:View ID="vw_Payment" runat="server">
                <table runat="server" align="right">
                    <tr><td>Username:</td><td>
                        <asp:Label ID="lbl_V3_Username" runat="server" Text=""></asp:Label></td></tr>
                    <tr><td>Available Balance:</td><td>
                        <asp:Label ID="lbl_V3_AbailableBalance" runat="server" Text=""></asp:Label></td></tr>
                </table>
                <br />
                <br />
                <table runat="server" class="table">
                    <tr>
                        <td>Flight</td>
                        <td>Date</td>
                        <td>Inhollandmiles</td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V3_Dep" runat="server" Text=""></asp:Label></td>
                        <td>
                            <asp:Label ID="lbl_V3_Dep_Date" runat="server" Text=""></asp:Label></td>
                        <td>
                            <asp:Label ID="lbl_V3_Dep_Miles" runat="server" Text=" "></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lbl_V3_Ret" runat="server" Text=""></asp:Label></td>
                        <td>
                            <asp:Label ID="lbl_V3_Ret_Date" runat="server" Text=""></asp:Label></td>
                        <td>
                            <asp:Label ID="lbl_V3_Ret_Miles" runat="server" Text=""></asp:Label></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>Total: </td>
                        <td>
                            <asp:Label ID="lbl_V3_Total" runat="server" Text=" "></asp:Label></td>
                    </tr>
                </table>
                <asp:Label ID="lbl_V3_Status" runat="server" Text="" ForeColor="Red" Font-Size="Medium"></asp:Label>
                <br />
                <br />
                <asp:Button ID="btn_V3_PreScreen" runat="server" CssClass="btn" OnClick="btn_V3_PreScreen_Click" Text="Previous Screen" />
                <asp:Button ID="btn_V3_Cancel" runat="server" CssClass="btn-danger" Text="Cancel Booking" OnClick="btn_V3_Cancel_Click" />
                <asp:Button ID="btn_V3_PayNow" runat="server" CssClass="btn-info" Text="Pay Now!" CausesValidation="False" OnClick="btn_V3_PayNow_Click" />
            </asp:View>            
        </asp:MultiView>    
    </form>
</asp:Content>
